package top.mingtea.propertymannagement.service;

import org.springframework.stereotype.Service;
import top.mingtea.propertymannagement.mapper.AdministratorMapper;
import top.mingtea.propertymannagement.pojo.Administrator;

@Service
public class AdminService {
    private final AdministratorMapper administratorMapper;

    public AdminService(AdministratorMapper administratorMapper) {
        this.administratorMapper = administratorMapper;
    }
    public boolean dologin(String username,String password) {
        Administrator administrator = administratorMapper.findbyAdminName(username);
        if (administrator != null && administrator.getAdmin_password().equals(password)) {
            return true;
        }
        return false;
    }
}
